package com.qf.pojo;

import java.util.List;

/**
 * @author bss
 * @version V1.0
 * @Project 02Day01
 * @Package com.qf.bean
 * @Description:
 * @Date 2022/9/14 15:57
 */
public class PageBean<T> {
    private long totalCount;//总条数
    private List<T> data;//数据
    private int pageNum;//当前页
    private int startPage;//开始页
    private int pageSize;//每页条数
    private int totalPage;//总页数
    private int endPage;

    public int getEndPage() {
        int tp = (int) Math.ceil(totalCount*1.0/pageSize);
        return tp;
    }

    public void setEndPage(int endPage) {
        this.endPage = endPage;
    }

    public long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(long totalCount) {
        this.totalCount = totalCount;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getStartPage() {
        return startPage;
    }

    public void setStartPage(int startPage) {
        this.startPage = startPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotalPage() {
        int tp = (int) Math.ceil(totalCount*1.0/pageSize);
        return tp;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    @Override
    public String toString() {
        return "PageBean{" +
                "totalCount=" + totalCount +
                ", data=" + data +
                ", pageNum=" + pageNum +
                ", startPage=" + startPage +
                ", pageSize=" + pageSize +
                ", totalPage=" + totalPage +
                ", endPage=" + endPage +
                '}';
    }
}
